
#include "Explosion.h"
#include "Graphics/ParticleSystem/OneTimeParticleEmitter.h"

Explosion::Explosion(unsigned num_particles, 
                     Vector2D position, Vector2D velocity_bias,
                     float emit_rand_min, float emit_rand_max,
                     float col_r, float col_g, float col_b,
                     float size, float duration, std::string texture){

    explosion_emitter = new OneTimeParticleEmitter(num_particles, position, velocity_bias, 
                                                   emit_rand_min, emit_rand_max,
                                                   col_r, col_g, col_b, 
                                                   0.0f, 0.1f, 
                                                   size, size/8.0f, 
                                                   1.0f/duration, 0.1f/duration, 
                                                   0.0f, 0.0f, texture, true);
    explosion_psys = new ParticleSystem(explosion_emitter);
}

Explosion::~Explosion(){
    delete explosion_psys;
}

void Explosion::render(void){
    explosion_psys->render();
}

void Explosion::update(void){
    explosion_psys->update();
}

bool Explosion::active(void){
    return explosion_psys->active();
}

bool Explosion::resolveCollision(Ship *ship){
    return false;
}

bool Explosion::resolveCollision(Weapon *weapon){
    return false;
}

bool Explosion::resolveCollision(Map *map){
    return false;
}

